import I18Parse from '@/common/i18Parse';
import flowNodeLang from "@/locales/lang/impl/pages/bpm/flowNodeLang.js";
let lang = flowNodeLang;
let i18n=function (langKey,text) {
    return I18Parse.getI18Val(lang,langKey, text)
}
var tmp =`
<div class="rx-npmn-window">
<div class="flow-window-container">
<div class="flow-window-content">
<ul>
    <%
    var histories = data.histories;
    var hasHistory=histories && histories.length>0;
    var users= data.taskNodeUser.configExecutors;
    %>
    <li class="flow-item-li" >
        <div class="flow-item-icon"></div>
         <div class="flow-item-text">
            <div class="flow-item-header">
                <span class="flow-item-name"><%=data.taskNodeUser.nodeText %>
                     <% var type = data.taskNodeUser.multiInstance;
                    if(type && type == 'parallel'){%>
                        <span class="flow-node-text flow-node-text-type">${i18n('list.parallel','并行')}</span>
                    <%}else if(type == 'sequential'){%>
                        <span class="flow-node-text flow-node-text-type">${i18n('list.serial','串行')}</span>
                    <%}%>
                </span>

            </div>
            <%if(!hasHistory){%>
            <div class="flow-item-title">
                <%for(var i = 0;i< users.length;i++ ){
                    var user=users[i];
                %>
                    <span class="flow-node-text"><%=user.name %></span>
                <%}%>
            </div>
            <%}%>
            <div class="history-content">
            <%
            var flag=false;
            for(var n = 0,m = histories.length;n < m ;n++ ){
                var history= histories[n];
                var handlerId = history.handlerId ;
                flag=true;
                var createTime = history.createTime ;
                var jumpTypeName = history.jumpTypeName;
                var updateTime =history.updateTime ;
                var remark = history.remark || "" ;
                var handlerUserName=history.handlerUserName ;
            %>
                  <div class="flow-item-details">
                    <dl>
                        <%if(handlerUserName){%><dd>
                            <span class="leftText">${i18n('list.approver','审批人')}&nbsp;&nbsp;&nbsp;:</span>
                            <span class="rightText"><span class="flow-node-text"><%=handlerUserName%></span></span>
                        </dd><%}%>
                        <dd>
                            <span class="leftText">${i18n('list.arrivalTime','到达时间')}:</span>
                            <span class="rightText"><%=createTime%></span>
                        </dd>
                        <dd>
                            <span class="leftText">${i18n('list.approvalTime','审批时间')}:</span>
                            <span class="rightText"><%=updateTime%></span>
                        </dd>
                        <dd>
                            <span class="leftText">${i18n('list.approvalAction','审批动作')}:</span>
                            <span class="rightText"><span class="flow-node-text"><%=jumpTypeName%></span></span>
                        </dd>
                        <dd>
                            <span class="leftText">${i18n('list.approvalRemark','审批意见')}:</span>
                            <span class="rightText"><%=remark%></span>
                        </dd>
                    </dl>
                </div>
                <% if (n < m-1) { %>
                <div class="split-line"></div>
                <% } %>
             <%}if(!flag){%>
                <div class="noedit"><span class="empty">暂无操作</span></div>
            <%}%>
             </div>
        </div>
    </li>

</ul>
</div>
</div>
</div>
`



export default tmp;
